Media file upload awareness for online systems

ABSTRACT

An online system stores media files (i.e., stored media files) and receives a user request to upload a video file (i.e., a requested media file). The online system determines whether the requested media file matches one of the stored media files based on hash values. If there is a mismatch in hash value, the online system may determine the match based on fingerprints. If it is determined that the requested media file does not match any stored media file, the online system stores the requested media file. Even if there is a match, the online system compares a quality of the requested media file with the matched media file and replaces the matched media file with the requested media file having a higher quality metric.

BACKGROUND

This disclosure relates generally to storing media files online systems,and more particularly to uploading media files (e.g., videos) to onlinesystems while avoiding duplication of the media files at the onlinesystems.

Online systems have become increasingly prevalent in digital contentdistribution and consumption, and allow users to more easily communicatewith one another. Users of an online system associate with other onlinesystem users, forming a web of connections. Additionally, users mayshare personal information and other stories with other users connectedto them via an online system. Examples of information shared by onlinesystem users include videos, songs, contact information, backgroundinformation, job information, interests, photos, notes, and/or othermember-specific data.

An online system stores media files, such as pictures, video files,audio files, documents, etc., for presenting to users of the onlinesystem. An online system user may view, express preference, comment onor share a stored media file. The media files may be uploaded by usersof the online system or curated by the online system. For example, anonline system allows an online system user to upload media files thatare created by the online system user or acquired by the online systemuser from third-party sources. Thus, an online system user can decidewhat media files to share with other users connected to the user at theonline system, e.g., through a newsfeed of the user. Those other usersconnected to the user may view, express preference, comment on or sharea media file uploaded by the user. Allowing online system users toupload media files in which they are likely to have an interestencourages additional use of the online system by the online systemusers. However, storing and managing a large corpus of media files at anonline system often requires a large amount of computing and storageresources. Online system users may request to upload a media file thatis already stored in the online system (e.g., by the same online systemuser or a different online system user). Accepting any media files foruploading without discretion may lead to inefficient use of computingand storage resources of an online system.

SUMMARY

An online system stores media files (referred to as “stored mediafiles”) that can be presented to users of the online system. Also, auser of the online system may request, e.g., via a client deviceassociated with the user, to upload a media file (referred to as“requested media file”) to the online system. In some embodiments, therequested media file includes a header section and a content section. Toavoid uploading duplicates of media files stored in the online system,the online system determines whether the requested media file matchesone of the stored media files. If there is a match, the requested mediafile is not allowed to be uploaded to the online system unless it hasbetter quality than the matched media file that has already existed inthe online system.

In one embodiment, the online system determines whether the requestedmedia file matches one of the stored media files based on hash values ofthe requested media file and the stored media files. For example, theonline system determines whether a hash of the requested media filematches corresponding hash values of the stored media files. A hashvalue of a media file is a value that is generated from the media fileusing a hash function and uniquely identifies the media file. In someembodiments, the hash value of the requested media file is generatedfrom the header section of the requested media file, i.e., a header hashvalue. In one embodiment, the client device sends the header hash valueof the requested media file to the online system. In another embodiment,the online system generates the header hash value from the headersection of the requested media file. A mismatch of header hash values ofthe requested media file and the stored media files indicates that therequested media file may be a new media file for the online system. Theonline system allows the client device to upload the requested mediafile. Additionally, the online system may determine the match based onhash values of a selected portion of the requested media file (e.g., thecontent portion) or an entirety of the requested media file andcorresponding portion or the entirety of one of the stored media files.

In another embodiment, the online system determines whether therequested media file matches one of the stored media files based onfingerprints of the requested media file and the stored media files. Forexample, the online system determines whether a fingerprint of therequested media file marches corresponding fingerprints of stored mediafiles. A fingerprint of a media file uniquely identifies the media file.A fingerprint of a media file can be an audio fingerprint or videofingerprint. In one embodiment, a fingerprint of a media file isgenerated from the content portion of the media file. A determinationthat the fingerprint of the requested media file does not match that ofany of the stored media files indicates the content of the requestedmedia file is not a duplicate of content of any of the stored mediafiles. Accordingly, the online system allows the client device to uploadthe requested media file and stores the uploaded requested media file.

Examples of media files include images, video files, audio files,documents, etc. For the purpose of illustration, the description belowuses video files as an example. However, the disclosure also applies toother types of media files.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a system environment in which an onlinesystem operates, in accordance with an embodiment.

FIG. 2 is a block diagram of an online system having an upload awarenessmodule, in accordance with an embodiment.

FIG. 3 is a block diagram of an upload awareness module of the onlinesystem, in accordance with an embodiment.

FIG. 4 is file structure diagram illustrating an example of a requestedvideo file and a stored video file, in accordance with an embodiment.

FIG. 5 is a flowchart illustrating a process for storing a non-duplicatevideo file uploaded by a user at the online system, in accordance withan embodiment.

FIG. 6 is a flowchart illustrating a process for storing a betterquality video file uploaded by a user at the online system, inaccordance with an embodiment.

FIG. 7 is an interaction diagram between a client device and the onlinesystem for determining whether to upload a video file from the clientdevice to the online system, in accordance with an embodiment.

The figures depict various embodiments for purposes of illustrationonly. One skilled in the art will readily recognize from the followingdiscussion that alternative embodiments of the structures and methodsillustrated herein may be employed without departing from the principlesdescribed herein.

DETAILED DESCRIPTION

System Architecture

FIG. 1 is a block diagram of a system environment 100 in which an onlinesystem 140 operates, in accordance with an embodiment. The systemenvironment 100 shown by FIG. 1 comprises one or more client devices110, a network 120, one or more third-party systems 130, and the onlinesystem 140. In alternative configurations, different and/or additionalcomponents may be included in the system environment 100. The onlinesystem 140 may comprise a social networking system, a content sharingnetwork, or another system providing content to users.

The client devices 110 are computing devices capable of receiving userinput as well as transmitting and/or receiving data via the network 120.In one embodiment, a client device 110 is a conventional computersystem, such as a desktop or a laptop computer. Alternatively, a clientdevice 110 may be a device having computer functionality, such as apersonal digital assistant (PDA), a mobile telephone, a smartphone, oranother suitable device. A client device 110 is configured tocommunicate via the network 120. In one embodiment, a client device 110executes an application allowing a user of the client device 110 tointeract with the online system 140. For example, a client device 110executes a browser application to enable interaction between the clientdevice 110 and the online system 140 via the network 120. In anotherembodiment, a client device 110 interacts with the online system 140through an application programming interface (API) running on a nativeoperating system of the client device 110, such as IOS® or ANDROID™.

In one embodiment, a client device 110 executes a software module 112for uploading a video file to the online system 140. For example, thesoftware module 112 generates a hash value for each video file to beuploaded to the online system by applying a hash function to a portion(e.g., a header portion) or entire length of the video file. Thesoftware module 112 provides the hash value of a video file and anidentification of the video file in an upload request to the onlinesystem 140. Upon receiving an approval for uploading from the onlinesystem 140, the software module 112 uploads the requested video file tothe online system 140. In response to receiving a reference to therequested video file (e.g., a URL to the requested video file), thesoftware module 112 stores the references to the requested video file atthe client device 110.

The client devices 110 are configured to communicate via the network120, which may comprise any combination of local area and/or wide areanetworks, using both wired and/or wireless communication systems. In oneembodiment, the network 120 uses standard communications technologiesand/or protocols. For example, the network 120 includes communicationlinks using technologies such as Ethernet, 802.11, worldwideinteroperability for microwave access (WiMAX), 3G, 4G, code divisionmultiple access (CDMA), digital subscriber line (DSL), etc. Examples ofnetworking protocols used for communicating via the network 120 includemultiprotocol label switching (MPLS), transmission controlprotocol/Internet protocol (TCP/IP), hypertext transport protocol(HTTP), simple mail transfer protocol (SMTP), and file transfer protocol(FTP). Data exchanged over the network 120 may be represented using anysuitable format, such as hypertext markup language (HTML) or extensiblemarkup language (XML). In some embodiments, all or some of thecommunication links of the network 120 may be encrypted using anysuitable technique or techniques.

One or more third party systems 130 may be coupled to the network 120for communicating with the online system 140, which is further describedbelow in conjunction with FIG. 2. In one embodiment, a third partysystem 130 is an application provider communicating informationdescribing applications for execution by a client device 110 orcommunicating data to client devices 110 for use by an applicationexecuting on the client device 110. In other embodiments, a third partysystem 130 provides content or other information for presentation via aclient device 110. A third party system 130 may also communicateinformation to the online system 140, such as advertisements, content,or information about an application provided by the third party system130.

FIG. 2 is a block diagram of an online system 140, in accordance with anembodiment. The online system 140 shown in FIG. 2 includes a userprofile store 205, a content store 210, an action logger 215, an actionlog 220, an edge store 225, a web server 230 and an upload awarenessmodule 240. In other embodiments, the online system 140 may includeadditional, fewer, or different components for various applications.Conventional components such as network interfaces, security functions,load balancers, failover servers, management and network operationsconsoles, and the like are not shown so as to not obscure the details ofthe system architecture.

Each user of the online system 140 is associated with a user profile,which is stored in the user profile store 205. A user profile includesdeclarative information about the user that was explicitly shared by theuser and may also include profile information inferred by the onlinesystem 140. In one embodiment, a user profile includes multiple datafields, each describing one or more attributes of the correspondingonline system user. Examples of information stored in a user profileinclude biographic, demographic, and other types of descriptiveinformation, such as work experience, educational history, gender,hobbies or preferences, location and the like. A user profile may alsostore other information provided by the user, for example, images orvideos. In certain embodiments, images of users may be tagged withinformation identifying the online system users displayed in an image,with information identifying the images in which a user is tagged storedin the user profile of the user. A user profile in the user profilestore 205 may also maintain references to actions by the correspondinguser performed on content items in the content store 210 and stored inthe action log 220, e.g., uploading media files to the online system140.

While user profiles in the user profile store 205 are frequentlyassociated with individuals, allowing individuals to interact with eachother via the online system 140, user profiles may also be stored forentities such as businesses or organizations. This allows an entity toestablish a presence on the online system 140 for connecting andexchanging content with other online system users. The entity may postinformation about itself, about its products or provide otherinformation to users of the online system 140 using a brand pageassociated with the entity's user profile. Other users of the onlinesystem 140 may connect to the brand page to receive information postedto the brand page or to receive information from the brand page. A userprofile associated with the brand page may include information about theentity itself, providing users with background or informational dataabout the entity.

The content store 210 stores objects. Each of the objects representsvarious types of content. Examples of content represented by an objectinclude an uploaded video file, a page post, a status update, aphotograph, a media file (e.g., an image, an audio, a video, or adocument), a link, a shared content item, a gaming applicationachievement, a check-in event at a local business, a brand page, or anyother type of content. The content store 210 may also store informationdescribing or otherwise related to the content. For example, the contentstore 210 can store hash values (e.g., header hash values and contenthash values) and fingerprints (e.g., audio fingerprints and videofingerprints) of the stored media files.

Online system users may create objects stored by the content store 210,such as status updates, photos tagged by users to be associated withother objects in the online system 140, events, groups or applications.In some embodiments, objects are received from third-party applicationsseparate from the online system 140. In one embodiment, objects in thecontent store 210 represent single pieces of content, or content“items.” Hence, online system users are encouraged to communicate witheach other by posting text and content items of various types of mediato the online system 140 through various communication channels. Thisincreases the amount of interaction of users with each other andincreases the frequency with which users interact within the onlinesystem 140.

The action logger 215 receives communications about user actionsinternal to and/or external to the online system 140, populating theaction log 220 with information about user actions. Examples of actionsinclude adding a connection to another user, sending a message toanother user, uploading an image, reading a message from another user,viewing content associated with another user, and attending an eventposted by another user. In addition, a number of actions may involve anobject and one or more particular users, so these actions are associatedwith the particular users as well and stored in the action log 220.

The action log 220 may be used by the online system 140 to track useractions on the online system 140, as well as actions on third partysystems 130 that communicate information to the online system 140. Usersmay interact with various objects on the online system 140, andinformation describing these interactions is stored in the action log220. Examples of interactions with objects include: commenting on posts,sharing links, checking-in to physical locations via a client device110, accessing content items, and any other suitable interactions.Additional examples of interactions with objects on the online system140 that are included in the action log 220 include: commenting on aphoto album, communicating with a user, establishing a connection withan object, joining an event, joining a group, creating an event,authorizing an application, using an application, expressing apreference for an object (“liking” the object), and engaging in atransaction. Additionally, the action log 220 may record a user'sinteractions with advertisements on the online system 140 as well aswith other applications operating on the online system 140. In someembodiments, data from the action log 220 is used to infer interests orpreferences of a user, augmenting the interests included in the user'suser profile and allowing a more complete understanding of userpreferences.

The action log 220 may also store user actions taken on a third partysystem 130, such as an external website, and communicated to the onlinesystem 140. For example, an e-commerce website may recognize a user ofan online system 140 through a social plug-in enabling the e-commercewebsite to identify the user of the online system 140. Because users ofthe online system 140 are uniquely identifiable, e-commerce websites,such as in the preceding example, may communicate information about auser's actions outside of the online system 140 to the online system 140for association with the user. Hence, the action log 220 may recordinformation about actions users perform on a third party system 130,including webpage viewing histories, advertisements that were engaged,purchases made, and other patterns from shopping and buying.Additionally, actions a user performs via an application associated witha third party system 130 and executing on a client device 110 may becommunicated to the action logger 215 by the application for recordationand association with the user in the action log 220.

In one embodiment, the edge store 225 stores information describingconnections between users and other objects on the online system 140 asedges. Some edges may be defined by users, allowing users to specifytheir relationships with other users. For example, users may generateedges with other users that parallel the users' real-life relationships,such as friends, co-workers, partners, and so forth. Other edges aregenerated when users interact with objects in the online system 140,such as expressing interest in a page on the online system 140, sharinga link with other users of the online system 140, and commenting onposts made by other users of the online system 140.

An edge may include various features each representing characteristicsof interactions between users, interactions between users and objects,or interactions between objects. For example, features included in anedge describe a rate of interaction between two users, how recently twousers have interacted with each other, a rate or an amount ofinformation retrieved by one user about an object, or numbers and typesof comments posted by a user about an object. The features may alsorepresent information describing a particular object or user. Forexample, a feature may represent the level of interest that a user hasin a particular topic, the rate at which the user logs into the onlinesystem 140, or information describing demographic information about theuser. Each feature may be associated with a source object or user, atarget object or user, and a feature value. A feature may be specifiedas an expression based on values describing the source object or user,the target object or user, or interactions between the source object oruser and target object or user; hence, an edge may be represented as oneor more feature expressions.

The edge store 225 also stores information about edges, such as affinityscores for objects, interests, and other users. Affinity scores, or“affinities,” may be computed by the online system 140 over time toapproximate a user's interest in an object or in another user in theonline system 140 based on the actions performed by the user. A user'saffinity may be computed by the online system 140 over time toapproximate the user's interest in an object, in a topic, or in anotheruser in the online system 140 based on actions performed by the user.Computation of affinity is further described in U.S. patent applicationSer. No. 12/978,265, filed on Dec. 23, 2010, U.S. patent applicationSer. No. 13/690,254, filed on Nov. 30, 2012, U.S. patent applicationSer. No. 13/689,969, filed on Nov. 30, 2012, and U.S. patent applicationSer. No. 13/690,088, filed on Nov. 30, 2012, each of which is herebyincorporated by reference in its entirety. Multiple interactions betweena user and a specific object may be stored as a single edge in the edgestore 225, in one embodiment. Alternatively, each interaction between auser and a specific object is stored as a separate edge. In someembodiments, connections between users may be stored in the user profilestore 205, or the user profile store 205 may access the edge store 225to determine connections between users.

The web server 230 links the online system 140 via the network 120 tothe one or more client devices 110, as well as to the one or more thirdparty systems 130. The web server 230 serves web pages, as well as othercontent, such as JAVA®, FLASH®, XML and so forth. The web server 230 mayprovide application programming interface (API) functionality to senddata directly to native client device operating systems, such as IOS®,ANDROID™, or BlackberryOS. Additionally, the web server 230 may receiveand route messages between the online system 140 and the client device110, for example, instant messages, queued messages (e.g., email), textmessages, short message service (SMS) messages, or messages sent usingany other suitable messaging technique. A user may send a request, e.g.,through a client device 110, to the web server 230 to upload videofiles. A video file that a user requests to upload is a requested videofile. However, the requested video file may be duplicate to one of theplurality of video files stored in the content store 210 (i.e., storedvideo files). To avoid such duplication, the web server 230 receivingthe user request to upload may send the user request to the uploadawareness module 240.

The upload awareness module 240 processes the user request for uploadinga video file and determines whether to allow upload of a requested videofile and whether to store the requested video file, if uploaded, at thecontent store 210. For example, the upload awareness module 240determines whether the requested video file matches any of the storedvideo files. If there is no match, the requested video file is likely anew video file to the online system 140 and is stored at the onlinesystem 140. Likewise, if there is a match, the requested video file isnot stored at the online system 140. In some embodiments, even there isa match, the upload awareness module 240 compares a quality of therequested video file with the matched video file stored at the onlinesystem 140 and replaces the matched video file with the requested videofile if the requested video file has a better quality. In this case, theexisting matched video file is deleted.

To determine whether the requested video file matches any of the storedvideo file, the upload awareness module 240 uses various methods. In oneembodiment, the upload awareness module 240 determines a match based onhash values of the requested video file and the stored video files. Ahash value of a video file is generated from the video file using a hashfunction and uniquely identifies the video file. A video file caninclude a header section and a content section. A hash value of thevideo file can be generated from either the header section (i.e., aheader hash value) or the content section (i.e., a content hash value).For example, the upload awareness module 240 compare a header hash valueof the requested video file with corresponding header hash values of thestored video files. The header hash value of the requested video file isgenerated by applying a hash function to a header section of therequested video file that includes metadata describing the requestedvideo file. The header hash value of a video file has much smalleramount of data compared with the original video file. Thus, comparisonof header hash values of video files is more efficient than comparisonof the whole video files.

An exact match of the header hash value of the requested video file andthe header hash value of a stored video file indicates that therequested video file matches the stored video file. The upload awarenessmodule 240 can deny the user's request to upload the requested videofile because the online system 140 already has a matching video file.Additionally, the upload awareness module 240 may store a reference tothe matched video file (e.g., a URL to the matched video file) and allowthe user and/or other online system users to access the matched videofile through the reference.

A mismatch of the header hash value of the requested video file andheader hash values the stored video files indicates that the requestedvideo file may be a new video file to the online system 140. The uploadawareness module 240 can allow the upload of the requested video file.In one embodiments where the header hash value of a video file isgenerated from only the header portion of the video file, a mismatchbased on the header hash values may not necessarily mean that therequested video file and stored video files have different content. Forexample, a requested video file from a client device has the same videocontent as a stored video file, but was transcoded once to be suitablefor the client device, which results in a different header file than theone for the stored video filed (e.g., different resolutions). The headerhash value of the requested video file and the header hash value of thestored video file in this example are different as a result of thedifferent header files, which results in a mismatch between therequested video file and the stored video file based on the header hashvalue comparison.

The upload awareness module 240 can further determine whether thecontent of the requested video file matches content of one of the storedvideo files. In one embodiment, the content match is based onfingerprints of the video files. In another embodiment, the contentmatch is based on hash values of the content of the video files. Acontent hash value of a video file is a hash value generated from acontent section of the video file. Responsive to the content of therequest video file not matching content of any of the stored video filesbased on the content hash values or fingerprints comparison, the uploadawareness module 240 determines that the requested video file does notmatch any of the stored video files. The requested video file can bestored at the content store 210.

A fingerprint of a video file is a compact representation of thecharacteristic features of content of the video file that can be used tocategorize the content and distinguish it from perceptually differentvideo files. A video file can include an audio signal (e.g., audioframes describing the sound of the video file) and a video signal (e.g.,a sequence of video frames of the video file). Accordingly, thefingerprint of the video file can be an audio fingerprint generated fromthe audio signal or a video fingerprint generated from the video signal.Taking audio fingerprint generation as an example, an audiofingerprinting algorithm preprocess the audio signal of a video file byapplying one or more operations to the audio signal, such as extractingmetadata associated with the audio signal, normalizing the amplitude anddividing the audio signal into multiple audio frames. The audiofingerprinting algorithm further transforms the audio signal by applyinga time-to-frequency domain transform (e.g., STFT transform). Thetransformed audio signal is filtered by splitting each spectral frame ofthe transformed audio signal into multiple filter banks. Embodiments ofthe video fingerprinting algorithm extract characteristic features ofone or more frames containing the most important and perceptuallyessential part of the video signal. In one embodiment, the videofingerprinting algorithm detects scene boundaries, selects key framesand extracts features from the selected key frames to generate the videofingerprint.

In one embodiment, the user request includes the header hash value,content hash value or fingerprint of the requested video file. In analternative embodiment, the upload awareness module 240 generates theheader hash value, content hash value or fingerprint of the requestedvideo file and stores them at the online system 140 (e.g., the contentstore 210).

In some embodiments, even if the requested video file matches a storedvideo file, the upload awareness module 240 compares a video quality ofthe request video file with corresponding video quality of the matchedvideo file. Examples of metrics that may contribute to video qualityinclude bit rate, frame rate, and resolution, etc. If the uploadawareness module 240 determines that the requested video file has abetter quality, the requested video file is stored and the matched videofile is deleted from the content store 210. Likewise, if the matchedvideo file is determined to have a better quality, the requested videofile is not stored in the content store 210 and a reference to thematched video file in the content store 210 is stored in its place.

Upload Awareness Module

FIG. 3 is a block diagram of an upload awareness module 240 included inthe online system 140, in accordance with an embodiment. In theembodiment of FIG. 3, the upload awareness module 240 includes aninterface module 310, a duplication analysis 320, a quality comparisonmodule 330 and an instruction module 340. In other embodiments, theupload awareness module 240 may include additional, fewer, or differentcomponents for various applications.

The interface module 310 facilitates communication among other entitiesof the upload awareness module 240, the web server 230 and the contentstore 210. For example, the interface module 310 receives a user requestto upload a video file from the web server 230 or from a client device110 and sends the user request to the duplicate analysis module 320and/or the quality comparison module 330 to process the user request.The user request can include an identification of the requested videofile and information describing the requested video file, such as hashvalues and/or fingerprints of the requested video file. Also, theinterface module 310 can send storing instruction to the content store210 for storing video files or other types of data that the uploadawareness module 240 determines to store.

The duplicate analysis module 320 processes the user request receivedfrom the interface module 310 and determines whether the requested videofile in the user request matches any of the stored video files. Forexample, the duplicate analysis module 320 compares a hash value of therequested video file with corresponding hash value of each of the storedvideo files.

FIG. 4 is file structure diagram illustrating an example of a requestedvideo file 400 and a stored video file 450, in accordance with anembodiment. The requested video file 400 includes a header section 410and a content section 420. The stored video file 450 includes a headersection 460 and a content section 470. The header section 410 or 460includes metadata of the corresponding video file 400 or 450. Metadataof a video file includes information describing the video file. Forexample, the metadata of a video file includes information about time(e.g., when the video file is created or modified), location (e.g.,where the video file is created), description of content of the videofile, identification of the video file, keywords/tags of the video file,identity of a person who created or modified the video file, source ofthe video file (e.g., publisher and distributor of the video file), sizeof the video file, compression format of the video file (e.g., MPEG-4,H.264, H.265), frame rate, resolution, audio file format of companyingaudio of the video file, security encryption method, and the like.Accordingly, the metadata of a video file can be used to describe andidentify the video file. The metadata can be used to generate a hashvalue of the video file (i.e., a header hash value) using a hashfunction.

The content section 420 or 470 includes content of the correspondingvideo file 400 or 450. Content of a video file includes a sequence ofvideo frames and may also include audio. The content, e.g., the framesand/or the audio, can be used to generate a hash value of the video file(i.e., a content hash value) using a hash function. The hash functionfor the content hash value may be same or different from the hashfunction of the header hash value. Any known hash functions, e.g., MD5,can be used to generate header/content hash values of a video file.

In some embodiments, the header hash value of the requested video file400 may be generated by the client device 110 that is associated withthe user who requested to upload the requested video file 400. Forexample, the client device 110 sends the header hash value of therequested video file 400 together with the user request. The clientdevice may use a hash function specified by the online system 140, whichcan be the same hash function that the online system uses to generatehash values of the stored video file 450.

In some other embodiment, the header hash value of the requested videofile 400 may be generated by the online system 140, e.g., the uploadawareness module 240. For example, the upload awareness module 240,receiving the user request, accesses or requests the header section 410of the requested video file 400 and generates the header hash value fromthe metadata in the header section 410. The online system can alsogenerate the content hash value of the requested video file 400 uponreceiving the requested video file.

Turning back to FIG. 3, the duplicate analysis module 320 can start withcomparing a header hash value of the requested video file with headerhash values of the stored video files. An exact match of the header hashvalue of the requested video file 400 and a header hash value of astored video file can indicate that the two video files match. Amismatch of the header hash value of the requested video file and aheader hash value of each stored video file indicates that the requestedvideo file is not identical (including the header sections 410, 460) toany stored video file. However, it is possible that the requested videofile has the same content sections 420, 470 as one of the stored videofiles but with different header sections 410, 460 as described above.

The duplicate analysis module 320 can further compare a content hashvalue of the requested video file with content hash values of the storedvideo files based on video frames and/or audio frames of the requestedvideo file and the stored video files. If the content hash value of therequested video file does not match the content hash value of any storedvideo file, the requested video file has different content from any ofthe stored video files. An exact match of the content hash value of therequested video file with the content hash value of a stored video fileindicates that the requested video file has the same content as thestored video file.

In some embodiments, the duplicate analysis module 320 compares afingerprint of the requested video file with corresponding fingerprintsof the stored video files. The fingerprint of the requested video filecan be generated by the client device 110 or the online system 140,e.g., the duplicate analysis module 320, using a fingerprintingalgorithm. The requested video file can include an audio signal (e.g.,audio frames describing the sound of the video file) and a video signal(e.g., a sequence of video frames of the video file). Accordingly, thefingerprint of the requested video file can be an audio fingerprintgenerated from the audio signal or a video fingerprint generated fromthe video signal.

To match the audio fingerprint of the requested video file to the audiofingerprint of a stored video file, the duplicate analysis module 320calculates correlation between the audio fingerprint of the requestedvideo file and an audio fingerprint of a stored video file. Thecorrelation between the two audio fingerprints measures a degree ofmatch in audio characteristics between the two audio fingerprints.Examples of correlation calculation between two audio fingerprints canbe found from Patent Application No. 14/153,404.

The generated audio and/or video fingerprint of the requested video filecan be stored at the online system 140, e.g., the content store 210. Theduplicate analysis module 320 compares the fingerprint of the requestedvideo file with corresponding fingerprint of stored video files. Forexample, the duplicate analysis module 320 measures similarity betweenthe fingerprint of the requested video file and the fingerprint of eachstored video file. If the similarity measure between the requested videofile and a stored video file is above a threshold value, the duplicateanalysis module 320 determines that the requested video file matches thestored video file (i.e., matched video file).

The quality comparison module 330 determines whether the requested videofile has a better quality than the matched video file. For example, thequality comparison module 330 compares video quality of the two videofiles based on video quality evaluation. Examples of video qualityevaluation include measurement of bit rate, resolution, perceptualquality at frame level and/or macro-block level. The quality comparisonmodule 330 can apply various video quality evaluation methods toevaluate quality of the requested video file and the matched video filestored at the online system 140, including full reference methods,reduced reference methods, pixel-based methods, and combination ofthereof.

The instruction module 340 generates uploading and/or storinginstructions based on determination of the duplicate analysis module 320and the quality comparison module 330. For example, when the duplicateanalysis module 320 determines that the header hash value of therequested video file matches the header hash value of a stored videofile, the instruction module 340 generates an instruction for storing areference to the stored video file and another instruction for notallowing the upload of the requested video file. In another example,when the duplicate analysis module 320 determines that the header hashvalue of the requested video file does not match the header hash valueof a stored video file, the instruction module 340 generates aninstruction for allowing the upload of the requested video file.

When it is determined that the content of the uploaded video file doesnot match content of any of the stored video file or the uploaded videofile has a higher quality than a matched video file, the instructionmodule 340 generates an instruction for storing the uploaded video fileat the online system 140. Likewise, the instruction module 340 cangenerate the instruction for storing a reference to the stored videofile and deleting the uploaded video file (i.e., the requested videofile) when it is determined that the content of the uploaded video filematches content of a stored video file. In some embodiments, when theuploaded video file is determined to have a better quality than thematched video file, the instruction module 340 generate an instructionfor replacing the matched video file with the uploaded video file.

The uploading instructions can be sent, e.g., via the interface module310, to the client device 110. The storing instructions can be sent,e.g., via the interface module 310, to the content store 210 where thereference to the stored video file is stored.

Upload Awareness Processes

FIG. 5 is a flowchart illustrating a process for storing a non-duplicatevideo file uploaded by a user at the online system 140. In someembodiments, the process is performed by the upload awareness module 240of the online system 140, although some or all of the operations in themethod may be performed by other entities in other embodiments. In someembodiments, the operations in the flow chart are performed in adifferent order and can include different and/or additional steps.

The upload awareness module 240 receives 510 a user request from aclient device 110 to upload a video file (i.e., requested video file) tothe online system 140. The online system 140 stores a corpus of videofiles (i.e., stored video files) uploaded by its users or curated byitself and information about the stored video files, such as hash valuesand fingerprints. The upload awareness module 240 determines 520 whetherthe requested video file matches one of the video files stored at theonline system 140. In an embodiment, the determination 520 includesthree sub-steps. First, the upload awareness module 240 compares 523 ahash value of the requested video file with corresponding hash values ofthe stored video files. Second, the upload awareness module 240 compares525 a fingerprint of the requested video file with correspondingfingerprints of the stored video files. Third, the upload awarenessmodule 240 determines 527 that the requested video file does not matchone of the stored video files based on at least one of hash valuecomparison and fingerprint comparison. Steps 523, 525, and 527 may occurin a different sequence. For example, the upload awareness module 240compares fingerprints before it compares hash values. Upon determinationthat the requested video file does not match one of the stored videofiles, the upload awareness module 240 stores 530 the requested videofile at the online system 140.

FIG. 6 is a flowchart illustrating a process for storing a duplicate butbetter quality video file uploaded by a user at the online system 140.In some embodiments, the process is performed by the upload awarenessmodule 240 of the online system 140, although some or all of theoperations in the method may be performed by other entities in otherembodiments. In some embodiments, the operations in the flow chart areperformed in a different order and can include different and/oradditional steps.

The upload awareness module 240 receives 610 a user request from aclient device 110 to upload a video file (requested video file) to theonline system 140. The upload awareness module 240 determines 620whether the requested video file matches one of a plurality of videofiles stored at the online system 140 (stored video file). In oneembodiment, the upload awareness module 240 compares one or more hashvalues of the requested video file with corresponding hash values ofeach stored video file. Examples of hash values include a header hashvalue that is generated from metadata of a video file and a content hashvalue that is generated from content of a video file. In anotherembodiment, the upload awareness module 240 can compare a fingerprint ofthe requested video file (e.g., an audio fingerprint or videofingerprint or both) with corresponding fingerprints of each storedvideo file. If the hash values and/or fingerprint of the requested videofile match a stored video file, the upload awareness module 240determines that the requested video file matches the stored video file.Likewise, if a hash value and/or fingerprint of the requested video filedo not match any stored video file, the upload awareness module 240determines that the requested video file does not match any of thestored video files.

The upload awareness module 240 determines 630 whether the requestedvideo file has a better quality than the matched video file stored atthe online system 140. If the upload awareness module 240 determinesthat the requested video file has a better quality, the upload awarenessmodule 240 stores 640 the requested video file at the online system 140(e.g., the content store 210) and deletes the matched video file. If theupload awareness module 240 determines that the matched video file has abetter quality, the upload awareness module 240 stores 650 a referenceto the matched video file linking the requested video file with a lowerquality to the matched video file. The reference to the stored videofile can be presented to the user requesting the upload and/or otheronline system users that are connected with the user.

FIG. 7 is an interaction diagram between a client device 110 and theonline system 140 for determining whether to upload a video file fromthe client device to the online system, in accordance with anembodiment. In some embodiments, the operations in the interactiondiagrams are performed in a different order and can include differentand/or additional steps.

The client device 110 sends 702 a user request to upload a video file tothe online system 140. The client device 110 also sends 704 a hash valueof the video file to the online system 140. In one embodiment, theclient device 110 generates the hash value from metadata of the videofile. Alternatively, the client device 110 may acquire the hash valuefrom a third party. The online system 140 determines 706 that the hashvalue of the requested video file does not match corresponding hashvalues of video files stored at the online system 140 (i.e., storedvideo files). The online system 140 sends 708 an instruction to theclient device 110 to upload the requested video file. The online system140 receives 710 the requested video file. The online system 140generates 712 a fingerprint of the requested video file. The generationof the fingerprint may require the online system 140 to access contentof the requested video file. The fingerprint can be an audio fingerprintor a video fingerprint. In some embodiment, the online system 140generates both an audio fingerprint and a video fingerprint for theuploaded video file.

The online system 140 determines 714 that the fingerprint of therequested video file matches a corresponding fingerprint of a storedvideo file. The online system 140 compares 716 a quality of therequested video file to a corresponding quality of the matched videofile. Examples of the quality include bit rate and resolution at framelevel and/or macro-block level. Responsive to the requested video filehas a lower quality (or the same quality), the online system 140 stores718 a reference to the stored video file referencing the requested videofile and deletes the requested video file. The online system 140 sends720 the reference to the stored video file to the client device 110. Theclient device 110 displays 722 the reference to the stored video file.Accordingly, the user may access the stored video file, which has thesame content as the requested video file but has a better quality.

CONCLUSION

The foregoing description of the embodiments has been presented for thepurpose of illustration; it is not intended to be exhaustive or to limitthe patent rights to the precise forms disclosed. Persons skilled in therelevant art can appreciate that many modifications and variations arepossible in light of the above disclosure.

Some portions of this description describe the embodiments in terms ofalgorithms and symbolic representations of operations on information.These algorithmic descriptions and representations are commonly used bythose skilled in the data processing arts to convey the substance oftheir work effectively to others skilled in the art. These operations,while described functionally, computationally, or logically, areunderstood to be implemented by computer programs or equivalentelectrical circuits, microcode, or the like. Furthermore, it has alsoproven convenient at times, to refer to these arrangements of operationsas modules, without loss of generality. The described operations andtheir associated modules may be embodied in software, firmware,hardware, or any combinations thereof.

Any of the steps, operations, or processes described herein may beperformed or implemented with one or more hardware or software modules,alone or in combination with other devices. In one embodiment, asoftware module is implemented with a computer program productcomprising a computer-readable medium containing computer program code,which can be executed by a computer processor for performing any or allof the steps, operations, or processes described.

Embodiments may also relate to an apparatus for performing theoperations herein. This apparatus may be specially constructed for therequired purposes, and/or it may comprise a general-purpose computingdevice selectively activated or reconfigured by a computer programstored in the computer. Such a computer program may be stored in anon-transitory, tangible computer readable storage medium, or any typeof media suitable for storing electronic instructions, which may becoupled to a computer system bus. Furthermore, any computing systemsreferred to in the specification may include a single processor or maybe architectures employing multiple processor designs for increasedcomputing capability.

Embodiments may also relate to a product that is produced by a computingprocess described herein. Such a product may comprise informationresulting from a computing process, where the information is stored on anon-transitory, tangible computer readable storage medium and mayinclude any embodiment of a computer program product or other datacombination described herein.

Finally, the language used in the specification has been principallyselected for readability and instructional purposes, and it may not havebeen selected to delineate or circumscribe the patent rights. It istherefore intended that the scope of the patent rights be limited not bythis detailed description, but rather by any claims that issue on anapplication based hereon. Accordingly, the disclosure of the embodimentsis intended to be illustrative, but not limiting, of the scope of thepatent rights, which is set forth in the following claims.

What is claimed is:
 1. A computer-implemented method, comprising:receiving, by an online system storing a plurality of media files, arequest from a client device to upload a media file to the onlinesystem, each of the plurality of the stored media files and therequested media file comprising a header portion and a content portion,the request including a hash value of only the header portion of therequested media file that is generated by the client device by using ahash function specified by the online system; obtaining, by the onlinesystem, a hash value of only the header portion of each of the pluralityof the stored media files that is generated by the hash functionspecified by the online system; comparing, by the online system, thehash value of only the header portion of the requested media file andthe hash value of only the header portion of each of the plurality ofthe stored media files to determine the requested media file matcheseach of the plurality of the stored media files; responsive to therequested media file not matching any of the plurality of stored mediafiles, instructing, by the online system, the client device to uploadthe requested media file to the online system; storing, by the onlinesystem, the requested media file uploaded by the client device to astorage device at the online system; generating, by the online system, afingerprint of the content portion of the requested media file that isstored by the online system; comparing, by the online system, thefingerprint of the content portion of the requested media file and acorresponding fingerprint of the content portion of each of theplurality of the stored media files to determine whether the contentportion of the requested media file matches the content portion of anyof the plurality of stored media files based on the comparison of thefingerprints; and responsive to the content portion of the requestedmedia file matching the content portion of one of the plurality ofstored media files, removing, by the online system, the requested mediafile uploaded by the client device from the storage device at the onlinesystem; and responsive to the content portion of the requested mediafile not matching the content portion of a media file of the pluralityof the stored media files, storing the requested media file uploaded bythe client device from the storage device at the online system.
 2. Themethod of claim 1, further comprising providing a stored reference tothe matched media file to the client device.
 3. The method of claim 1,wherein the fingerprint of the content portion of the requested mediafile is an audio fingerprint generated from an audio signal of thecontent portion of the requested media file.
 4. The method of claim 1,wherein the fingerprint of the content portion of the requested mediafile is a video fingerprint generated from a video signal of the contentportion of the requested media file.
 5. The method of claim 1, whereincomparing a fingerprint of the content portion of the requested mediafile and a corresponding fingerprint of the content portion of each ofthe plurality of the stored media files comprises: for each of theplurality of stored media files, determining whether a similaritymeasure between the fingerprint of the content portion of the requestedmedia file and the corresponding fingerprint of the content portion ofthe stored media file is above a threshold value.
 6. The method of claim1, further comprising: responsive to the requested media file matching amedia file of the plurality of the stored media files: determiningwhether the requested media file has a higher quality metric than thematched media file; and responsive to determination that the requestedmedia file has a higher quality metric, replacing the matched media filewith the requested media file, wherein the higher quality metric isselected from a group consisting of a higher bit rate, a higher framerate, and a higher resolution.
 7. A computer program product comprisinga non-transitory computer readable storage medium having instructionsencoded thereon that, when executed by a processor, cause the processorto: receive, by an online system storing a plurality of media files, arequest from a client device to upload a media file to the onlinesystem, each of the plurality of the stored media files and therequested media file comprising a header portion and a content portion,the request including a hash value of only the header portion of therequested media file that is generated by the client device by using ahash function specified by the online system; obtain, by the onlinesystem, a hash value of only the header portion of each of the pluralityof the stored media files that is generated by the hash functionspecified by the online system; compare, by the online system, the hashvalue of only the header portion of the requested media file and thehash value of only the header portion of each of the plurality of thestored media files to determine the requested media file matches each ofthe plurality of the stored media files; responsive to the requestedmedia file not matching any of the plurality of stored media files,instruct, by the online system, the client device to upload therequested media file to the online system; store, by the online system,the requested media file uploaded by the client device to a storagedevice at the online system; generate, by the online system, afingerprint of the content portion of the requested media file that isstored by the online system; compare, by the online system, thefingerprint of the content portion of the requested media file and acorresponding fingerprint of the content portion of each of theplurality of the stored media files to determine whether the contentportion of the requested media file matches the content portion of anyof the plurality of stored media files based on the comparison of thefingerprints; and responsive to the content portion of the requestedmedia file matching the content portion of one of the plurality ofstored media files, remove, by the online system, the requested mediafile uploaded by the client device from the storage device at the onlinesystem; and responsive to the content portion of the requested mediafile not matching the content portion of a media file of the pluralityof the stored media files, store the requested media file uploaded bythe client device from the storage device at the online system.
 8. Thecomputer program product of claim 7, having further instructions that,when executed by the processor, cause the processor to provide a storedreference to the matched media file to the client device.
 9. Thecomputer program product of claim 7, wherein the fingerprint of thecontent portion of the requested media file is an audio fingerprintgenerated from an audio signal of the content portion of the requestedmedia file.
 10. The computer program product of claim 7, wherein thefingerprint of the content portion of the requested media file is avideo fingerprint generated from a video signal of the content portionof the requested media file.
 11. The computer program product of claim7, wherein the instructions for comparing a fingerprint of the contentportion of the requested media file and a corresponding fingerprint ofthe content portion of each of the plurality of the stored media filescomprise instructions that, when executed by a processor, cause theprocessor to: for each of the plurality of stored media files, determinewhether a similarity measure between the fingerprint of the contentportion of the requested media file and the corresponding fingerprint ofthe content portion of the stored media file is above a threshold value.12. The computer program product of claim 7, having further instructionsthat, when executed by the processor, cause the processor to: responsiveto the requested media file matches a media file of the plurality of thestored media files: determine whether the requested media file has ahigher quality metric than the matched media file; and responsive todetermination that the requested media file has a higher quality metric,replace the matched media file with the requested media file, whereinthe higher quality metric is selected from a group consisting of ahigher bit rate, a higher frame rate, and a higher resolution.
 13. Acomputer system, comprising: a non-transitory computer-readable storagemedium storing executable computer program instructions, the computerprogram instructions comprising instructions that when executed cause acomputer processor to perform steps, comprising: receiving, by an onlinesystem storing a plurality of media files, a request from a clientdevice to upload a media file to the online system, each of theplurality of the stored media files and the requested media filecomprising a header portion and a content portion, the request includinga hash value of only the header portion of the requested media file thatis generated by the client device by using a hash function specified bythe online system; obtaining, by the online system, a hash value of onlythe header portion of each of the plurality of the stored media filesthat is generated by the hash function specified by the online system;comparing, by the online system, the hash value of only the headerportion of the requested media file and the hash value of only theheader portion of each of the plurality of the stored media files todetermine the requested media file matches each of the plurality of thestored media files; responsive to the requested media file not matchingany of the plurality of stored media files, instructing, by the onlinesystem, the client device to upload the requested media file to theonline system; storing, by the online system, the requested media fileuploaded by the client device to a storage device at the online system;generating, by the online system, a fingerprint of the content portionof the requested media file that is stored by the online system;comparing, by the online system, the fingerprint of the content portionof the requested media file and a corresponding fingerprint of thecontent portion of each of the plurality of the stored media files todetermine whether the content portion of the requested media filematches the content portion of any of the plurality of stored mediafiles based on the comparison of the fingerprints; and responsive to thecontent portion of the requested media file matching the content portionof one of the plurality of stored media files, removing, by the onlinesystem, the requested media file uploaded by the client device from thestorage device at the online system; and responsive to the contentportion of the requested media file not matching the content portion ofa media file of the plurality of the stored media files, storing therequested media file uploaded by the client device from the storagedevice at the online system.
 14. The system of claim 13, whereincomparing a fingerprint of the content portion of the requested mediafile and a corresponding fingerprint of the content portion of each ofthe plurality of the stored media files comprises: for each of theplurality of stored media files, determining whether a similaritymeasure between the fingerprint of the content portion of the requestedmedia file and the corresponding fingerprint of the content portion ofthe stored media file is above a threshold value.